package com.ayu.springsecuritylearn.mapper;

import com.ayu.springsecuritylearn.pojo.SysUser;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @Author: 徐林玉//作者及
 * @Date: 2021/9/26//完成日期
 * @Description: //
 * @Version: v0.0.1 // 版本信息
 * @Function List: // 主要函数及其功能
 * @Others: // 其它内容的说明
 * @History: // 历史修改记录
 **/
public interface UserMapper extends Mapper<SysUser>
{


	@Select("select * from sys_user where username = #{username}")
	@Results({
			@Result(id = true, property = "id", column = "id"),
			@Result(property = "roles", column = "id", javaType = List.class,
					many = @Many(select = "com.ayu.springsecuritylearn.mapper.RoleMapper.findByUid"))
	})
	public SysUser findByName(String username);
}
